<?php
include_once("Security/SingleSignOn.php");
$SSO = new SingleSignOn;

include_once("Accounts.config.php");
global $DB;
$DB->query('select PasswordTemp,username,concat(firstname," ",lastname) as fullname from lwbc_main.users where upper(email) = upper(\'' . $_GET['email'] . '\')');
$row = $DB->fetch_row();

if($SSO->sendTemporaryPasswordEmail($row['username'],$row['PasswordTemp'],$_GET['email'],$row['fullname'])) {
	header("Location: /Accounts/index.php?action=newSuccess&resent=yes&email={$_GET['email']}");
}
else {
	header("Location: /Accounts/index.php?action=newSuccess&resent=no&email={$_GET['email']}");
}

?>